// Profiler
// (c) jimon game studio

#ifndef JEH_CPROFILER
#define JEH_CPROFILER

#include "IProfiler.h"

namespace je
{
	namespace core
	{
		//! Profiler
		class CProfiler:public je::core::IProfiler
		{
		protected:
			SectionsListType Sections;

			f32 DeleteTime;
			u1 EnableDelete;

		public:
			//! Constructor
			CProfiler();

			//! Destructor
			~CProfiler();

			// Return Sections List
			SectionsListType & GetSections()
			{
				return Sections;
			}

			//! Begin Section
			void BeginSection(jeStringc Name);

			//! End Section
			void EndSection(jeStringc Name);

			//! Set Auto Delete (by default, profiler delete all sections than open more than 5 secs)
			void SetAutoDelete(u1 Enable = true,f32 DelTime = 5000.0f);

			//! Loop Tick
			void LoopTick();
		};
	}
}

#endif
